home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 8
/
FM Towns Free Software Collection 8.iso
/
t_os
/
wtv
/
wtv.c
< prev
next >
Wrap
Text File
|
1994-06-01
|
3KB
|
154 lines
/* TV ワイド 化 */
#include <egb.h>
#include <mos.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <dos.h>
#include "Platform.h"
#include "aoi_lib2.h"
void wtv(int pORG, int pSCR)
{
int y, t;
char p0[360 * 2];
char p1[360 * 2];
char p2[360 * 120 * 2];
for (y = 0, t = 30; y < 60; y += 2, t++) {
EGB_writePage(work, pORG);
AOIgetGraph(p0, 0, y, 360, y);
AOIgetGraph(p1, 0, y + 180, 360, y + 180);
EGB_writePage(work, pSCR);
AOIputGraph(p0, 0, t, 360, t);
if (!((t + 150) > 208)) {
AOIputGraph(p1, 0, t + 150, 360, t + 150);
}
}
EGB_writePage(work, pORG);
AOIgetGraph(p2, 0, 60, 360, 180);
EGB_writePage(work, pSCR);
AOIputGraph(p2, 0, 60, 360, 180);
}
void wtv1(int pORG, int pSCR)
{
int y, t;
char p0[360 * 2];
char p1[360 * 2];
char p2[360 * 120 * 2];
for (y = 0, t = 30; y < 60; y += 2, t++) {
EGB_writePage(work, pORG);
AOIgetGraph(p0, 0, y, 360, y);
AOIgetGraph(p1, 0, y + 180, 360, y + 180);
EGB_writePage(work, pSCR);
AOIputGraph(p0, 0, t, 360, t);
if (!((t + 150) > 208)) {
AOIputGraph(p1, 0, t + 150, 360, t + 150);
}
}
}
void wtv3(int pORG, int pSCR)
{
char *p;
p = (char *)malloc(360 * 180 * 2 * sizeof(char));
if (p == NULL) return;
EGB_writePage(work, pORG);
AOIgetGraph(p, 0, 30, 360, 210);
EGB_writePage(work, pSCR);
AOIputGraph(p, 0, 30, 360, 210);
free(p);
}
void wtv2(int pORG, int pSCR)
{
int a, b;
char *p;
p = (char *)malloc(360 * 240 * 2 * sizeof(char));
EGB_writePage(work, pORG);
AOIgetGraph(p, 0, 0, 360, 240);
EGB_writePage(work, pSCR);
for (a = 1083, b = 2888; a < 173280; a += 722) {
memcpy(p + a, p + b, 720);
b += 1444;
}
AOIputGraph(p, 0, 60, 360, 120 + 60);
}
void main(void)
{
int endMark = 0;
int ch, x, y;
int mode = 0;
int oldMode = 0;
MOS_start(mwork, 4096);
EGB_init(work, 1536);
EGB_resolution(work, 0, 9);
EGB_resolution(work, 1, 9);
EGB_displayPage(work, 0, 1);
EGB_superImpose(work, 65);
EGB_writePage(work, 1);
EGB_digitize(work, 1);
do {
MOS_rdpos(&ch, &x, &y);
switch (ch) {
case 1 :
mode++;
if (mode == 3) mode = 0;
break;
case 2 :
endMark = 1;
break;
}
do {MOS_rdpos(&ch, &x, &y);} while (ch); // 一端マウスボタンを離さないと受け付けない
switch (mode) {
case 0 : // 縦圧縮
if (oldMode != mode) {
EGB_displayPage(work, 0, 1);
oldMode = mode;
}
wtv(1, 0);
break;
case 1 : // 縦圧縮 2
if (oldMode != mode) {
EGB_displayPage(work, 0, 3);
EGB_writePage(work, 0);
EGB_writeMode(work, 10);
AOIboxFull(0, 60, 360, 180, 0xffffffff);
EGB_writeMode(work, 0);
oldMode = mode;
}
wtv1(1, 0);
break;
case 2 : // 黒幕挿入
if (oldMode != mode) {
EGB_displayPage(work, 0, 3);
EGB_writePage(work, 0);
EGB_writeMode(work, 10);
AOIboxFull(0, 30, 360, 208, 0xffffffff);
EGB_writeMode(work, 0);
oldMode = mode;
}
break;
}
if (kbhit()) endMark = 1;
} while (endMark != 1);
MOS_end();
}